# 12分 3个错误 60Min
day=input()

def isprime(num):
    if num==2:
        return True
    if num<=1 or num%2==0:
        return False
    for i in range(3,int(num**0.5)+1,2):
        if num%i==0:
            return False
    return True

flag=0
for time in range(8):
    print(day[time:],end=' ')
    if isprime(int(day[time:])):
        print('Yes')
    else:
        print('No')
        flag=1

if flag==0:
    print("All Prime!")